//
//  SettingTableViewCell.m
//  EasyBuy
//
//  Created by Zhu Xiangjun on 10/10/12.
//  Copyright (c) 2012 shen donghao. All rights reserved.
//

#import "SettingTableViewCell.h"

@interface SettingTableViewCell(){
    UITextField *titleFiled;
    UIImageView *sinaView;
}

@end

@implementation SettingTableViewCell

-(void)dealloc{
    [super dealloc];
    [sinaView release];
    [titleFiled release];
}

-(void)initCellData:(NSString*) title :(int)style{
    
    titleFiled.text = title;
    
    if(style ==1){
        sinaView.hidden = NO;
    }

}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        UITextField *_titleField = [[UITextField alloc] initWithFrame:CGRectMake(50, 10, self.frame.size.width-30, self.frame.size.height)];
        _titleField.font      = [ UIFont systemFontOfSize:14.0f];
//        _titleField.textColor = [UIColor grayColor];
        _titleField.enabled   = NO;
        titleFiled            = _titleField;
        [self addSubview:titleFiled];
        [_titleField release];
        
        UIImage *image = [UIImage imageNamed:@"sina.png"];
        UIImageView *_sinaView = [[UIImageView alloc]initWithFrame:CGRectMake(20, (self.frame.size.height-image.size.height)/3, image.size.width, image.size.height)];
        [_sinaView setImage:image];
        _sinaView.hidden = YES;
        sinaView = _sinaView;
        [self addSubview:sinaView];
        [image release];
        [sinaView release];
        
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
}

@end
